﻿using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace ERP_RORZE_PRODUCT.Product.Incauhinh
{
    public partial class Rp_InLenh100 : DevExpress.XtraReports.UI.XtraReport
    {
        //public string sokehoach;
        //public string orderPKD;
        //public string sLCan;
        //public string SLLenh;
        //public string ThanLenh;
        //public string KichThuocPhoi;
        //public string LoaiPhoi;
        //public string CoCat;
        //public string GcongTho;

        //public string PartID;
        //public string Mono;

        //public string ThoiHanGcong;
        //public string LongRen;
        //public string PhunCat;
        //public string NgayIn;
        //public string ChuY;
        //public string Solenhnhapkho;
        private DataTable parent;

        public Rp_InLenh100(DataSet ds)
        {
            InitializeComponent();

            this.DataSource = ds;
            this.DataMember = ds.Tables["Table1"].TableName;

            DetailReport.DataMember = "Table1.DetailRelation";

            //this.parent = obLenh.OptionData;

            lblTopLeft.DataBindings.Add("Text", null, "Table1.Inside");
            lbSokehoach.DataBindings.Add("Text", null, "Table1.planNo");
            lbOrderPKD.DataBindings.Add("Text", null, "Table1.BOderNo");
            lbSLCan.DataBindings.Add("Text", null, "Table1.Qty");
            lbSLLenh.DataBindings.Add("Text", null, "Table1.MOQty");
            lbThanLenh.DataBindings.Add("Text", null, "Table1.Deadline");
            lbKichThuocPhoi.DataBindings.Add("Text", null, "Table1.Workpiecesize");
            lbLoaiPhoi.DataBindings.Add("Text", null, "Table1.MaterialType");
            lbCoCat.DataBindings.Add("Text", null, "Table1.Cut");
            lbGcongTho.DataBindings.Add("Text", null, "Table1.RawMachine");

            lbPartID.DataBindings.Add("Text", null, "Table1.PartID");
            lbMono.DataBindings.Add("Text", null, "Table1.MONo");

            lbThoiHanGcong.DataBindings.Add("Text", null, "Table1.THGC");
            lbLongRen.DataBindings.Add("Text", null, "Table1.HelisertQty");
            lbPhunCat.DataBindings.Add("Text", null, "Table1.BlastQty");
            lblNgayIn.Text = DateTime.Now.ToString("yyyy/MM/dd");
            lblChuY.DataBindings.Add("Text", null, "Table1.Memo");
            lblSolenhnhapkho.DataBindings.Add("Text", null, "Table1.MONo");

            //Detail (OptionData)
            lbNguyenCong.DataBindings.Add("Text", null, "Table1.DetailRelation.OptionID");
            lbMay.DataBindings.Add("Text", null, "Table1.DetailRelation.MachineID");
            lbDoga.DataBindings.Add("Text", null, "Table1.DetailRelation.Jig");
            lbSoDoga.DataBindings.Add("Text", null, "Table1.DetailRelation.JigID");

        }

        private void xrTableCell42_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
               //if (dataRow["Jig"].ToString() == "True")
               // {
               //     lbDoga.Text = "Yes";
               // }
               // else
               // {
               //     lbDoga.Text = "No";

               // }
            
        }

    }
}
